import fetch from "@/utils/fetch"

export function loginByUsername(loginname,pwd){
    const data={
        loginname,
        pwd
    }
    return fetch({
        url:'users/login',
        method:'post',
        headers: {'content-type': 'application/json;charset=UTF-8'},
        data:JSON.stringify(data)
    })
}

export function logout(){
    return fetch({
        url:'login/logout',
        method:'post'
    })
}
export function getiuserd(loginname){
    return fetch({
        url:'users/bigUserBigModelByloginName/'+loginname,
        headers: {'content-type': 'application/json;charset=UTF-8'},
        method:'get'
    })
}

export function getUserInfo(id){
    return fetch({
        url:'users/userInfo/'+id,
        method:'get',
    })
}
export function getPic(){
    return fetch({
        url:'/pic/pic',
        method:'post',
    })
}